home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98c.txt / 000109_icon-group-sender _Tue Dec 8 10:06:37 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA28737
  4.     for icon-group-addresses; Tue, 8 Dec 1998 10:06:28 -0700 (MST)
  5. Message-Id: <199812081706.KAA28737@baskerville.CS.Arizona.EDU>
  6. Date: Tue, 08 Dec 1998 03:52:39 -0600
  7. From: MJE <evans@gte.net>
  8. To: icon-group@optima.CS.Arizona.EDU
  9. Subject: Re: Past Keyword / Coexpr Help
  10. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  11. Status: RO
  12.  
  13. Clinton Jeffery wrote:
  14. > SW> procedure past(s)
  15. > SW>    suspend (tab(find(s)),match(s))
  16. > SW> end
  17. > NL> procedure past(s1, s2, i1, i2)
  18. > NL>    suspend find(s1, s2, i1, i2) + *s1
  19. > NL> end
  20. > MEvans> I like Steve Wampler's answer.  Since "find" is a generator,
  21. > MEvans> presumably this function will also behave as a generator.  I would
  22. > MEvans> still lobby for the "past" keyword, but no complaints.
  23. > Gee, both of these solutions behave just fine as a generator.  Nevin's
  24. > looks more efficient and works outside of string scanning environments.  :-)
  25. > For the record, I've wanted a past() function before, as well.  My code is
  26. > often riddled with find(s) + *s ...
  27. > Clint
  28.  
  29.  
  30.  
  31. What everyone is missing about procedures-that-do-the-job is the speed
  32. consideration.  Think about embedding either procedure in a deep inner
  33. loop of some kind.  At that point, it is much preferable to have a
  34. keyword, which
  35.  
  36. (a) avoids any overhead of procedure calling, (b) doesn't have to both
  37. find and then match the same text (redundancy), (c) simplifies the code
  38. readability
  39.  
  40. So with Clint I must say that the keyword is still a good idea.
  41.  
  42. Thanks for the advice however, it gets me off the dime.
  43.  
  44. Mark
  45.  
  46.  
  47.